package client;

import java.util.*;

import chatservice.IUserService;
import pojo.User;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.*;
import org.codehaus.xfire.service.binding.*;
import java.net.MalformedURLException;

public class UserClient {
	
	IUserService srvc;
	public UserClient()
	{
		Service srvcModel= new ObjectServiceFactory().create(IUserService.class);
		XFireProxyFactory factory=new XFireProxyFactory(XFireFactory.newInstance().getXFire());
		
		String userURL="http://localhost:8080/ToolService/services/UserService";
		
		try{
		     srvc=(IUserService)factory.create(srvcModel,userURL);
		//	System.out.println(" User Client run...");
			/*int reg=srvc.isRegister("hkj", "123");
			if(reg==0)
			{
				System.out.println("user is not register");
			}else if(reg==1)
			{
				System.out.println("user's password is illegal");
			}
			else
				System.out.println("userInfo correct!");*/
			//srvc.setUserRoomId("zhang", 2);
			//System.out.println("Success");
		}catch(MalformedURLException e)
		{
			e.printStackTrace();
		}
	}
	/*public Vector<User> getUserlist(int roomid)
	{
		Vector<User> userlist=srvc.getUserByRoomId(roomid);
		return userlist;
	}*/
}
